package com.shopping.miaosha.error;

public enum ErrorCode implements CommonError {
    //未定义异常
    UNKNOW_ERROR(10001,"未知异常"),

    //通用错误类型00001
    PARAMERTER_VALIDATION_ERROR(10001,"参数不合法"),

    //10000开头为用户信息相关错误
    USER_NOT_EXIST(20001,"用户不存在");


    private int errorCode;

    private String errorMsg;

    ErrorCode(int errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    @Override
    public int getCode() {
        return this.errorCode;
    }

    @Override
    public String getMsg() {
        return this.errorMsg;
    }

    @Override
    public CommonError setMsg(String errorMsg) {
        this.errorMsg = errorMsg;
        return this;
    }
}
